import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import terser from '@rollup/plugin-terser';
import serve from 'rollup-plugin-serve';
import livereload from 'rollup-plugin-livereload';

export default {
    input: 'src/main.js',
    output: {
        file: 'public/vue.js',
        format: 'iife',
        name: 'Vue',
        source:true
    },
    plugins: [
        resolve(),
        commonjs(),
        terser(),
        serve({
            open: true, // 启动服务器后打开浏览器
            contentBase: 'public', // 静态文件根目录
            port: 8080 // 服务器端口
        }),
        livereload({
            watch: 'public' // 监视 public 目录中的文件变化
        })
    ]
};
